home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-06-22 | 1.0 KB | 53 lines | [TEXT/MPS ] |
- Program Ext_PlayPict;
-
- Uses MemTypes, QuickDraw, OSIntf,
- ToolIntf, PackIntf, Sound;
-
- Var
- DPict:PicHandle;
- DFile, DSound:integer;
-
- procedure PlayPict(
- var Numer, Denom:integer;
- var MyPict:PicHandle);
-
- type
- FFSynthHandle=^FFSynthPtr;
-
- var
- MySound:FFSynthHandle;
- MyPtr:Ptr;
- MyFFPtr:FFSynthPtr;
-
- begin
- {make sure that we recieved something}
- if MyPict<>Nil then
- begin
- {Coerce the handle}
- MySound:=FFSynthHandle(MyPict);
- {Lock the sound so we don't lose it}
- HLock(Handle(MySound));
- {Copy the pointer}
- MyPtr:=Ptr(MySound^);
- {Type Coerce the pointer}
- MyFFPtr:=FFSynthPtr(MyPtr);
- {Set the playback mode}
- MyFFPtr^.mode:=FFMode;
- {Set the playback count to the}
- {parameters passed.}
- MyFFPtr^.count:=FixRatio(Numer, Denom);
- MyFFPtr^.wavebytes[0]:=0;
- {Play the sound}
- StartSound(MyPtr,
- GetHandleSize(Handle(MySound)),
- POINTER(-1));
- {Unlock the sound so it can be}
- {disposed}
- HUnLock(Handle(MySound));
- end; {if MyPict<>Nil}
- end; {PlayPict}
-
- Begin
- PlayPict(DFile, DSound, DPict);
- End. {Main Block}
-